#!/bin/bash

#重置别名
resetAliases() {
        #创建命令别名文件
    if [ ! -f /home/${user}/.bash_aliases ]; then
        touch /home/${user}/.bash_aliases
        
        
    fi

    importalias=$(cat /home/${user}/.bashrc | grep .bash_aliases)
    if [ ! $? -eq 0 ]; then
        echo "
    if [ -f ~/.bash_aliases ]; then
        . ~/.bash_aliases
    fi
    " >>/home/${user}/.bashrc
        source /home/${user}/.bashrc
    fi

    echo "alias unzip='unzip -O CP936'" >>/home/${user}/.bash_aliases

    source /home/${user}/.bash_aliases
}

resetAliases